{% extends 'base.html.twig' %}
{% block body_bar %}
    <h5>{{ dry_translation('list') }}</h5>
    <div class="ibox-tools">
        <a class="btn btn-outline btn-info" href="{{ path("setting_new") }}" data-route="setting_new">{{ dry_translation('new') }}</a>
    </div>
{% endblock %}
{% block body %}
    <table class="table table-striped">
        <thead>
            <tr>
                <th>{{ dry_translation('Setting.id') }}</th>
                <th>{{ dry_translation('Setting.dryGroup') }}</th>
                <th>{{ dry_translation('Setting.dryName') }}</th>
                <th>{{ dry_translation('Setting.dryValue') }}</th>
                <th>{{ dry_translation('Setting.drySort') }}</th>
                <th>{{ dry_translation('Setting.dryAddtime') }}</th>
                <th>{{ dry_translation('Setting.dryNote') }}</th>
                <th>{{ dry_translation('Setting.dryUseDetail') }}</th>
                <th>{{ dry_translation('Setting.dryIsJsonString') }}</th>
                <th>{{ dry_translation('Setting.jsonFormatCheck') }}</th>
                <th>{{ dry_translation('action') }}</th>
            </tr>
        </thead>
        <tbody>
            {% for setting in settings %}
            <tr>
                <td>{{ setting.id }}</td>
                <td>{{ dryGroupArray[setting.dryGroup] }}</td>
                <td>{{ setting.dryName }}</td>
                {% if setting.dryUseDetail == 'yes' %}
                    <td>{{ call_method('detailShow', setting.dryValue)|raw }}</td>
                {% else %}
                    <td>{{ setting.dryValue|raw }}</td>
                {% endif %}
                <td>{{ setting.drySort }}</td>
                <td>{{ setting.dryAddtimeString }}</td>
                <td>{{ setting.dryNote }}</td>
                <td>{{ call_method('statusShow', dryUseDetailArray, setting.dryUseDetail)|raw }}</td>
                <td>{{ call_method('statusShow', dryIsJsonStringArray, setting.dryIsJsonString)|raw }}</td>
                {% if setting.dryIsJsonString == 'yes' %}
                    <td>{{ call_method('statusShow', isCorrectArray, setting.dryValue is is_json_string)|raw }}</td>
                {% else %}
                    <td>&nbsp;</td>
                {% endif %}
                <td>
                    <div class="btn-group">
                        <a class="btn btn-primary" href="{{ dry_path('setting_show', setting.id) }}" data-route="setting_show">{{ dry_translation('show') }}</a>
                        <a class="btn btn-primary" href="{{ dry_path('setting_edit', setting.id) }}" data-route="setting_edit">{{ dry_translation('edit') }}</a>
                    </div>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    <div class="text-center">{{ pageCode|raw }}</div>
{% endblock %}
